//
//  UITestViewController.m
//  TestIos
//
//  Created by hs on 2020/10/11.
//  Copyright © 2020 Liyadong. All rights reserved.
//

#import "UITestViewController.h"
#import "UIView+cornerRadius.h"
#import "UIColor+Extend.h"
#import "HsLCSexChooseView.h"
#import "HsPopViewTool.h"
#import "HsBaseBottomPopTool.h"
#import "HsLCPersonInfoEditView.h"
#import "HsLCPersonDesEditView.h"

 
@interface UITestViewController ()


/** floatview */
@property (nonatomic, strong) HsLCSexChooseView *photoChooseView;
 

/** nickChange */
@property (nonatomic, strong) HsLCPersonInfoEditView *nickNameEditView;


/** desView */
@property (nonatomic, strong) HsLCPersonDesEditView *desEditView;

@end

@implementation UITestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    NSLog(@"view did load");
    

    
    UIButton *testBtn0 = [UIButton buttonWithType:UIButtonTypeCustom];
    testBtn0.frame = CGRectMake(50, 100, 200, 50);
    [testBtn0 setTitle:@"点一下" forState:UIControlStateNormal];
    [testBtn0 setBackgroundColor:[UIColor greenColor]];
    [testBtn0 addTarget:self action:@selector(handlButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:testBtn0];
    
    UIButton *testBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    testBtn.frame = CGRectMake(50, 200, 200, 50);
    [testBtn setTitle:@"点一下" forState:UIControlStateNormal];
    [testBtn setBackgroundColor:[UIColor greenColor]];
    [testBtn addTarget:self action:@selector(handlButtonAction0:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:testBtn];
    
    [self.photoChooseView updateChooseWithIndex:1];
    
}

- (HsLCSexChooseView *)photoChooseView {
    if (!_photoChooseView) {
        _photoChooseView = [[HsLCSexChooseView alloc] createChooseView];
        _photoChooseView.clickAction = ^(NSInteger index) {
            [[HsBaseBottomPopTool shareInstance] dismissBottomView];
        };
    }
    return _photoChooseView;
}

- (HsLCPersonInfoEditView *)nickNameEditView {
    if (!_nickNameEditView) {
        _nickNameEditView = [[HsLCPersonInfoEditView alloc] createEditNameView];
        _nickNameEditView.closeClick = ^{
            [[HsPopViewTool sharedInstance] closeWithBlcok:^{
                
            }];
        };
        _nickNameEditView.sureClick = ^(NSString * _Nonnull msg) {
          
        };
    }
    return _nickNameEditView;
}

- (HsLCPersonDesEditView *)desEditView {
    if (!_desEditView) {
        _desEditView = [[HsLCPersonDesEditView alloc] createPersonDesView];
        _desEditView.closeClick = ^{
            [[HsPopViewTool sharedInstance] closeWithBlcok:^{
                
            }];
        };
        _desEditView.sureClick = ^(NSString * _Nonnull msg) {
           
        };
    }
    return _desEditView;
}


- (void)handlButtonAction:(id)sender {
    [[HsBaseBottomPopTool shareInstance] showBottomViewWithDetailView:self.photoChooseView height:HsLCSexChooseView_H delegate:self];
    
}

- (void)handlButtonAction0:(id)sender {
    [[HsPopViewTool sharedInstance] showWithPresentView:self.desEditView animated:YES];
    [self.desEditView updateInfoShowWithText:@""];
}

@end
